﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="adconsultingLang.ascx.cs" Inherits="admin_adconsultingLang" %>
<center>
<table width="100%">
    <tr>
        <td>Ngôn ngữ :</td>
        <td>
            <asp:DropDownList ID="lang" runat="server" DataSourceID="SqlDataSource1" 
                DataTextField="lang" DataValueField="id">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
                SelectCommand="SELECT * FROM [Languages]"></asp:SqlDataSource>
        </td>
    </tr>
    <tr>
        <td>Menu: </td>
        <td>
            <asp:TextBox ID="menu" runat="server" Width="346px" Height="22px"></asp:TextBox>
            </td>
    </tr>
    <tr>
        <td>Tiêu đề</td>
        <td>
            <asp:TextBox ID="title" runat="server" Width="346px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2"><center><asp:Button runat="server" ID="addbt" Text="Thêm" 
                onclick="addbt_Click"/></center></td>
    </tr>
</table>
</center>
<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
    DataKeyNames="id,lang" datasourceid="SqlDataSource2" 
    EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
    onrowcommand="GridView1_RowCommand" onrowcreated="GridView1_RowCreated" 
    onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
    PageSize="5" Width="100%">
    <RowStyle BackColor="#EFF3FB" VerticalAlign="Middle" />
    <EmptyDataRowStyle VerticalAlign="Middle" />
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#459300" HorizontalAlign="Center" />
    <EmptyDataTemplate>
        <asp:Label ID="Label3" runat="server" Text="Chưa có dữ liệu"></asp:Label>
    </EmptyDataTemplate>
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#57A000" Font-Bold="True" ForeColor="White" />
    <Columns>
        <asp:TemplateField HeaderText="id" SortExpression="id" Visible="False">
            <EditItemTemplate>
                <asp:Label ID="id" runat="server" Text='<%# Eval("id") %>'></asp:Label>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="id" runat="server" Text='<%# Bind("id") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Ngôn ngữ" SortExpression="lang" ItemStyle-HorizontalAlign=Center>
            <EditItemTemplate>
                <asp:Label ID="lg" runat="server" Text='<%# Eval("lang") %>'></asp:Label>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="lg" runat="server" Text='<%# Bind("lang") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:BoundField DataField="menu" HeaderText="Menu" SortExpression="menu" ItemStyle-HorizontalAlign=Center/>
        <asp:BoundField DataField="title" HeaderText="Tiêu đề" SortExpression="title" ItemStyle-HorizontalAlign=Center/>
        <asp:CommandField ButtonType="Button" EditText="Sửa" ShowEditButton="True" ItemStyle-HorizontalAlign=Center/>
        <asp:CommandField ButtonType="Button" DeleteText="Xóa" ItemStyle-HorizontalAlign=Center
            ShowDeleteButton="True" />
    </Columns>
    <EditRowStyle BackColor="#003366" VerticalAlign="Middle" />
    <AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
    SelectCommand="SELECT * FROM [Consulting_lang] WHERE ([id] = @id)">
    <SelectParameters>
        <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>
